import service from ".";

const courseApi = {
    //分页查询
    search(params) {
        return service.get(
            '/course',
            {params}
        ).then(response=>response.data)
    },
    //添加课程
    add(course) {
        return service.post(
            '/course',
            course
        ).then(response=>response.data)
    },
    //修改课程
    edit(course) {
        return service.put(
            '/course',
            course
        ).then(response=>response.data)
    },
    //删除课程
    remove(id) {
        return service.delete(
            '/course/'+id
        ).then(response=>response.data)
    }
}
//对外提供courseApi
export default courseApi